<template>
  <div>
    <p>你要购买的数量：{{ count }}</p>
    <button v-on:click="count = count + 1">+1</button>
    <button v-on:click="addFn">+1</button>
    <button v-on:click="addFnNum(5)">+5</button>
    <br>简写形式：“@”：
    <button @click="count = count + 1">+1</button>
    <button @click="addFn">+1</button>
    <button @click="addFnNum(5)">+5</button>
  </div>
</template>

<script>
export default {
  data(){
    return {
      count: 1
    }
  },
  methods: {
    addFn() {
      this.count++
    },
    addFnNum(num){
      this.count += num 
    }
  }
}
</script>

<style>

</style>